<?xml version="1.0" encoding="utf-8" ?>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<jsp:include page="/commonPart/htmlHeader2.jsp">
	<jsp:param name="title" value="博客-${userInfo.name}-CommonWorld" />
</jsp:include>
<body>
<div id = "CW_Screen" >
	<jsp:include page= "/commonPart/bodyHeader2.jsp" ></jsp:include>
	<div class = "CW_Content">
		<div id = "SpaceLeft">
			<jsp:include page = "/commonPart/MySpaceLeft.jsp" ></jsp:include>
			<jsp:include page = "/commonPart/BlogSpaceLeft.jsp" ></jsp:include>
		</div>
		<style>
			.BlogList .Blog h2 a {vertical-align: middle;}
			.icon {width: 20px; height: 20px; line-height: 20px; vertical-align: middle; display: inline-block; font-size: 14px; text-align: center; color: #fff; font-weight: bold;}
			.BlogStat {font-size: 12px; line-height: 20px;}
			.BlogStat .g {color: #40aa53;}
			.BlogTags {margin-top: 8px;}
			.BlogList .outline .stat {vertical-align: middle;}
			.BlogTitle {border-bottom: none;}
		</style>
		<div class = "SpaceList BlogList">
			<div class = "TopBar">
				<div class = "NavPath">
					<a href = "${userUrls.admin}">空间</a> &raquo; 
					<a href = "${userUrls.blog}">博客</a> 
					<c:if test = "${!empty param.catalog}">
						&raquo; <a href = "${userUrls.blog}?catalog=${param.catalog}"></a>
					</c:if>
				</div>
				<div class = "PreviewMod" style = "margin-left: 10px;">
					排序: <a href = "?p=${currentPage}&catalog=${currentCatalog}&sort=${sort == 'hot' ? 'time' : 'hot'}" class = "active">${sort == 'hot' ? '按时间' : '按热度'}</a>
				</div>
			</div>
			<ul>
				<c:forEach items="${blogList}" var="blogInfo">
					<li class = "Blog" id = "blog_${blogInfo.blogId}">
						<div class = "BlogTitle">
							<div class = "title">
								<h2>
									<span class = "icon" style = "background: ${blogInfo.type == '原创' ? '#44ac57' : '#799acc'};" title = "${blogInfo.type}">${blogInfo.type == "原创" ? "原" : "转"}</span>
									<c:if test="${blogInfo.privacy == 1}">
										<span class = "icon" style = "background: #FFA500;" title = "私密文章">私</span>
									</c:if>
									<a href = "${blogInfo.url}">${blogInfo.title}</a>
								</h2>
							</div>
							<div class = "outline">
								<span class = "catalog">
									分类:<a href = "?catalog=${blogInfo.catalogId}">${blogInfo.catalogName}</a>
								</span>
								<span class = "date">发布于 ${blogInfo.writeDateInterval}(${blogInfo.writeDate}), </span>
								<span class = "stat">统计: ${blogInfo.commentCount}评/${blogInfo.readCount}阅/${blogInfo.praiseCount}赞</span>
							</div>
						</div>
					</li>
				</c:forEach>
			</ul>
			<ul class = "pager">
				<c:if test="${currentPage > 1}">
					<li class = "page prev">
						<a href = "?catalog=${currentCatalog}&sort=${sort}&p=${currentPage - 1}">&lt;</a>
					</li>
				</c:if>
				<c:if test = "${beginIndex > 1 }">
					<li class = "page">
						<a href = "?catalog=${currentCatalog}&sort=${sort}&p=1">1</a>
					</li>
				</c:if>
				<c:forEach items="${pages}" var = "page">
					<li class = "page ${currentPage == page ? 'current' : ''}">
						<a href = "?catalog=${currentCatalog}&sort=${sort}&p=${page}">${page}</a>
					</li>
				</c:forEach>
				<c:if test = "${endIndex < totalPage}">
					<li class = "page">
						<a href = "?catalog=${currentCatalog}&sort=${sort}&p=${totalPage}">${totalPage}</a>
					</li>
				</c:if>
				<c:if test = "${currentPage < totalPage}">
					<li class = "page next">
						<a href = "?catalog=${currentCatalog}&sort=${sort}&p=${currentPage + 1}">&gt;</a>
					</li>
				</c:if>
			</ul>
		</div>
	</div>
	<div class = "clear"></div>
	<div id = "footer"></div>
</div>
</body>
</html>